// TODO: Once reaction ui is enabled, use `rui button success`
.rui.card.order .controls .btn-success {
  .btn-success();
  border-radius: 0;
}


.order-panel {
  cursor: hand;
  cursor: pointer;
}

.order-panel.panel-info {
  box-shadow: 0 0 0 3px @brand-accent-color;
}

.order-panel > .panel-heading {
  .display(flex);
  padding: 0;
}

.order-panel > .panel-body {
  .display(flex);
}

.order-details {
  .display(flex);
  .flex-wrap(wrap);
  .flex(1 1 auto);
  padding: 10px;
}

.order-controls {
  .display(flex);
  .flex-direction(column);
  width: 44px;
  height: 100%;
  button {
    flex: 1 1 auto;
    border-radius: 0;
    height: 100%;
    width: 100%;
  }
}

.order-detail-item {
  .display(flex);
  .flex(1 1 auto);
}

.order-detail-item .cart-totals {
  white-space: nowrap;
}

.order-panel-items {
  flex: 1 1 auto;
}

.order-panel-items .order-item {
  padding: 1rem 1.2rem;
}

.order-panel-status {
  flex: 0 0 auto;
}

.order-item-details {
  flex: 4;
  margin-left: 20px;
  align-items: center;
}

.order-detail-quantity {
  flex: 1;
}

.order-detail-price {
  flex: 1;
  margin-left: 15px
}


.orders-list{
  .circular-icon {
    width: 40px;
    height: 40px;
    margin: -16px 0px;
    background-size: 40px;
    border: 4px solid rgba(129, 122, 122, 0.62);
    border-radius: 50%;
    padding: 16px;
    display: inline-block;
  }

}

.orders-list-tabs {
  border-bottom: 1px solid @border-color;
}

.order-detail {
    border: 2px solid gray;
}

.orders-grid .h3 {
    margin-top: 0px;
}

.order-list-detail {
  address {
    margin-bottom: 0;
  }
  .order-group-title {
    margin-top: 20px;
    margin-bottom: 5px;
  }

}

.order-item-img {
  height: 75px;
  width: 75px;
}

.order-list-item-details {
  margin-top: 25px;
  padding-bottom: 25px;
  border-bottom: 1px solid @gray-lighter;
}


.order-items {
  list-style-type: none;
  margin-bottom: 0px;
  padding-top: 10px;
  padding-bottom: 1px;
  cursor: pointer;

  &.invoice-item {
    margin-bottom: 10px;
  }

  &.selected {
    background-color: @rui-info-bg;
  }
}

.order-item {
  .display(flex);
}

.invoice-line-items:hover {
  background-color: @list-group-hover-bg;
  cursor: pointer;
}

.invoice-popover-controls {
  margin-top: 10px;
  margin-bottom: 10px;
  display: flex;
  width: 100%;
  height: 30px;

  .invoice-popover-selected {
    flex: 7;
    padding-top: 2px;
    padding-left: 10px;

    i {
      font-size: 18px;
    }

    span {
      font-size: 16px;
      left: 5px;
      position: relative;
      top: 0px;
    }
  }

  .invoice-popover-close {
    flex: 1;
  }
}

.invoice-order-items {
  margin-bottom: 10px;
  padding: 10px;
  background-color: #f7f7f7;

  .invoice-order-item-tax {
    display: flex;
    width: 100%;

    b {
      flex: 4;
    }

    .tax-code {
      flex: 1
    }

    .tax-cost {
      text-align: right;
      flex: 1;
    }
  }

  .invoice-order-item-shipping {
    display: flex;

    b {
      flex: 4
    }
  }

  .invoice-order-item-subtotal {
    display: flex;

    b {
      flex: 4
    }
  }
}

.invoice-actions {
  display: flex;
  padding-top: 20px;

  div {
    &.invoice-action-cancel {
      flex: 2;
      margin-right: 10px;
    }
    &.invoice-action-refund {
      flex: 1;
      button {
        width: 100%;
      }
    }
  }
}

.invoice-refund-edited {
  width: 100%;
  padding-bottom: 10px;

  .refund-header {
    display: flex;
    border-bottom: 1px solid @black25;
    padding: 10px;

    div {
      flex: 1;

      &:first-child {
        flex: 4;
      }

      &:last-child {
        text-align: right;
      }

      span {
        color: @rui-danger;
        font-weight: 600;
      }
    }
  }

  .refund-body {
    margin-top: 10px;
    .refund-item {
      padding: 10px;
      margin-bottom: 4px;
      display: flex;
      background: @rui-danger-bg;

      div {
        flex: 1;

        &:first-child {
          flex: 5
        }

        &:last-child {
          text-align: right;
        }
      }

      &.return {
        span {
          color: @rui-danger
        }
      }
    }
  }

  .refund-include-shipping {
    height: 30px;

    input {
      margin-right: 8px;
    }

    span {
      top: -5px;
      position: relative;
    }
  }
}

.invoice {
  margin-left: -15px;
  margin-right: -15px;
}

.refund-container {
  margin-top: 10px;

  .refund-input {
    margin-bottom: 5px;
    margin-right: 15px;
  }

  .refund-button {
    height: 34px;
    margin-left: 10px;
    margin-bottom: 5px;
  }
}

.cancel-order-btn {
  margin-top: 10px;
  margin-bottom: 10px;
}

.roll-up-invoice-list {
  background-color: @pre-bg;
  margin-left: -15px;
  margin-right: -15px;
}

.order-payment-list-item {
  background-color: @pre-bg;
  padding: 15px;
  margin-bottom: 15px;
}

.order-payment-action-area {
  margin-top: 20px;
  margin-bottom: 5px;
}

.roll-up-content {
  padding: 15px;
}

.order-item-media {
  .flex(0 0 auto);
  width: 40px;
  margin-left: 15px;

  &.popover-mode {
    margin-left: 0;
  }

  img {
    width: 100%;
  }
}

.order-shipments {
  list-style-type: none;
}

// Order form summary
.order-summary-form-group {
  .display(flex);
  .align-items(center);

  > .reason {
    .flex(1 1 auto);
    .margin-right(20px);
    .text-align(right);
  }

  > .amount {
    .flex(0 0 auto);
    width: 100px;
  }

  > .invoice-details {
    .flex(1 1 auto);
    .text-align(right);
  }
}

.invoice-summary {
  .display(flex);
  border-bottom: 1px solid @rui-default-disabled;
  &:first-child {
    border-top: 1px solid @rui-default-disabled;
  }

  margin-right: -15px;
  margin-left: -15px;
  line-height: 3;

  > .invoice-label {
    flex: 2;
    .text-align(left);
    padding-left: 15px;
  }

  > .invoice-label.refund {
    flex: 1;
    border-right: solid 1px @rui-default-disabled;
  }

  > .invoice-details {
    flex: 1;
    .text-align(right);
    padding-right: 15px;

    > .refundAmount {
      .text-align(left);
      flex: 2;
    }
    > .refundSubmit {
      flex: 1;
    }
  }

    .captured-total {
      background-color: @rui-success-bg;
    }
    .adjusted-total {
      background-color: @rui-brand-bg;
    }
    .refund {
      background-color: @pre-bg;
    }
}

.invoice-actions-container {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

// New LESS for React orders panel
.rui.card.order {
  width: 100%;
  border: solid 1px @black20;
  margin-bottom: 20px;

  .controls {
    width: 10%;
    max-width: 66px;
    border-left: 1px solid @black10;
  }

  .content {
    padding: 0px;
    width: 90%;
    overflow-x: hidden;
  }

  .shipment-info {
    padding: 10px;
    border-bottom: solid 1px @black20;
    .display(flex);
    flex-direction: row;

    .customer-info {
      .flex(1 1 auto);

      .rui-order-avatar {
        .margin-right(10px);
      }
    }
    .workflow-info {
      .flex(1 1 auto);
      display: flex;
      justify-content: flex-end;

      .badge {
        .margin-left(10px);
      }
    }
  }

  .order-info {
    padding: 10px;
    .display(flex);
    flex-direction: column;

    .order-totals {
      .display(flex);
      flex-direction: row;

      .order-data {
        .flex(1 1);

        &.order-data-date {
          .text-align(left);
        }
        &.order-data-id {
          text-align: center;
        }
        &.order-data-total {
          .text-align(right);
        }
      }

    }

    .order-items {
      .display(flex);
      flex-direction: row;
      flex-wrap: wrap;
      justify-content: flex-start;
      margin-top: 20px;
      margin-bottom: 30px;
      height: 40px;

      &.invoice-item {
        padding-top: 8px;
        height: 56px;
        margin-bottom: 10px;
      }

      .order-item {
        flex: 0 0 auto;
        position: relative;
        width: 50px;
        height: 50px;

        .margin-right(20px);
        margin-bottom: 20px;

        .badge {
          position: absolute;
          bottom: -8px;
          right: -8px;
          z-index: 10;
        }
      }
    }
  }
}

.rtl .rui.card.order {
  .controls {
    border-right: 1px solid @black10;
    border-left: none;
  }
}

// Invoice Styling

.invoice-popover {
  width: 408px;
  max-height: 600px;
  overflow-y: scroll;
  padding-top: 0px;
  padding: 10px;
  padding-bottom: 30px;
  border-radius: 4px;
  background-color: @white;
  border: solid 1px #7894a4;
}

.invoice-popover-checkbox {
  padding-left: 10px;
  -webkit-flex: 1;
  flex: 0;
  border: 1px
}

.invoice-popover-controls {
  margin-top: 10px;
  margin-bottom: 10px;
  display: flex;
  width: 100%;
  height: 30px;

  .checkbox-large {
    margin-left: 10px;
  }

  .invoice-popover-selected {
    flex: 7;
    padding-top: 2px;
    padding-left: 10px;

    i {
      font-size: 18px;
    }

    span {
      font-size: 16px;
      left: 5px;
      position: relative;
      top: 0px;
    }
  }

  .invoice-popover-close {
    flex: 1;
  }
}

.rollover-checkbox {
    &.order-invoice-rollover {
      .selected-checkbox {
        padding-right: 6px;
        padding-left: 17px;
        padding-top: 5px;

        .checkbox-avatar {
          margin-left: -6px;
          border-radius: 2px;
          border: solid 2px #5e6264;
          background: transparent;
        }
      }

      .second-child {
        padding-right: 6px;
        padding-left: 17px;
        padding-top: 5px;

        .checkbox-avatar {
          margin-left: -6px;
          border-radius: 2px;
          border: solid 2px #5e6264;
        }
      }
    }
  }
// Order Table Styles
.rui.order.table {
  border-top: none;
  width: auto;

  @media only screen and (max-width: 740px) {
      max-width: 100%;
      > div {
        margin: 0 auto;
      }
  }

  @media screen and (max-width: 745px) and (min-width: 710px) {
    div[data-radium] {
      display: none;
    }
  }

  // Table Headers
  .order-table-header-name {
    border-right: none;
    .text-align(left);
    padding-top: 8px;

    min-width: 20%;
    max-width: 100%;
  }
  .order-table-header-email {
    border-right: none;
    text-align: center;
    padding-top: 19px;

    min-width: 15%;
    max-width: 100%;
  }
  .order-table-header-date {
    border-right: none;
    text-align: center;
    padding-top: 19px;

    min-width: 10%;
    max-width: 100%;
  }
  .order-table-header-id {
    border-right: none;
    text-align: center;
    padding-top: 19px;

    min-width: 5%;
    max-width: 50%;
  }
  .order-table-header-total {
    border-right: none;
    text-align: center;
    padding-top: 19px;

    min-width: 15%;
    max-width: 50%;
  }
  .order-table-header-shipping {
    border-right: none;
    text-align: center;
    padding-top: 19px;

    min-width: 15%;
    max-width: 100%;
  }
  .order-table-header-status {
    border-right: none;
    text-align: center;
    padding-top: 19px;

    min-width: 15%;
    max-width: 100%;
  }

  .order-table-header-control {
    min-width: 5%;
    max-width: 50%;
  }

  // Table Columns
  .order-table-column-name {
    border-right: 1px solid @black10;

    min-width: 20%;
    max-width: 100%;
  }
  .order-table-column-email {
    text-align: center;
    min-width: 15%;
    max-width: 100%;
  }
  .order-table-column-date {
    text-align: center;

    min-width: 10%;
    max-width: 100%;
  }
  .order-table-column-id {
    text-align: center;

    min-width: 5%;
    max-width: 50%;
  }
  .order-table-column-total {
    text-align: center;

    min-width: 15%;
    max-width: 50%;
  }
  .order-table-column-shipping {
    text-align: center;
    margin-top: 2px;

    min-width: 15%;
    max-width: 100%;
  }
  .order-table-column-status {
    text-align: center;
    margin-top: 2px;

    min-width: 15%;
    max-width: 100%;
  }

  .order-table-column-control {
    .display(flex);
    .flex-direction(column);
    // height: 100%;
    padding: 0;
    height: 49px;
    min-width: 5%;
    max-width: 50%;
    button {
      flex: 1 1 auto;
      border-radius: 0;
      height: 100%;
      width: 100%;
      background-color: transparent;
    }
  }

  .order-table-column-control .btn-success {
    .btn-success();
    border-radius: 0;
  }

  // Name cell display
  .order-table-name-cell {
    display: inline-flex;
    .padding-left(5px);
  }

  // Checkbox Styling
  .order-header-checkbox {
    margin-top: 10px;
    margin-bottom: 0px;
    .margin-right(10px);
    border-radius: 2px;
    border: solid 2px @black65;
  }

  .column-name-name {
    margin-top: 10;
  }

  .order-table-pagination-visible {
    border-top: none;
    margin-top: 10px;
    margin-bottom: 10px;
  }

  .order-table-thead {
    border-top: 1px solid @black10;
    border-right: 1px solid @black10;
    border-left: 1px solid @black10;
  }

  .order-table-details-tr-group {
    border-right: none;
    border-left: none;
    border-bottom: none;
  }

  .rt-tr.order-table-detail-tr:hover {
    background: transparent
  }

  .order-table-tr-group {
    border-right: 1px solid @black10;
    border-left: 1px solid @black10;
  }

  .order-table-list {
    border-bottom: 1px solid @black10;
  }

  .order-table-detail {
    border-bottom: none;
  }

  .rt-tbody {
    .rt-tr.selected-row {
      background-color: #e8fcf6;
    }
  }

  .rt-noData {
      top: 75%
  }
}

.rtl .rui.order.table {
  .order-table-column-name {
  border-left: 1px solid @black10;
  border-right: none;
  }
}

.rollover-checkbox {

  .second-child {
    padding-right: 6px;

    .checkbox-avatar {
      margin-left: -6px;
      border-radius: 2px;
      border: solid 2px @black65;
    }
  }
}

.all-checkboxes {
  padding-right: 6px;

  .checkbox-avatar {
    margin-left: 4px;
    border-radius: 2px;
    border: solid 2px @black65;
    background: transparent;
  }
}

strong.orders-full-name {
  margin-top: 7px;
  .padding-left(5px);
}

.rui.order.table.table-header-hidden {
  .rt-thead {
    border-bottom: none;

    .rt-tr {
      display: none;
    }
  }
}

.rui.order.table.table-header-visible {
  .rt-thead {
    .rt-tr {
      height: 56px;
    }
  }
}

.order-toggle-btn, .badge-basic.orders-badge {
  background: transparent;
}

.bulk-order-actions-bar {
  height: 68px;
  background-color: darken(#fff, 3%);
  padding-top: 20px;
  margin-top: 67px;

  .orders-checkbox {
    .margin-left(11px);
    vertical-align: -7px;
  }

  .selected-orders {
    font-size: 15px;
    font-weight: bold;
    color: @rui-brand;
    .margin-left(20px);
    vertical-align: middle;
  }

  .capture-orders-button, .bulk-actions-button {
    width: 176px;
    text-align: center;
    .margin-left(30px);
    vertical-align: middle;
  }

  .bulk-actions-button {
    i {
      .margin-left(25px);
    }
  }

  .shipping-flow-list {
    position: relative;
    z-index: 1;
    width: 286px;
    .margin-left(256px);
    margin-top: 14px;
    border: solid 1px @rui-default;
    border-radius: 3px;
    background-color: @white;

    &:before, &:after {
      content: '';
      position: absolute;
      display: block;
      border-style: solid;
      .left(82.5%);
      z-index: 100;
    }

    &:before {
      top: -21px;
      border-color: transparent transparent @rui-default transparent;
      border-width: 10px;
    }

    &:after {
      top: -19px;
      border-color: transparent transparent @white transparent;
      border-width: 10px;
    }

    .list-group-item {
      background-color: @rui-default-bg;
      height:47px;
      border: none;
      margin-bottom: 2px;
    }

    .list-group-item.selected {
      background-color: darken(#fff, 3%);
    }

    .list-item-content {
      font-size: 15px;
      font-weight: 600;
      color: @black80;
      letter-spacing: 0.3px;
    }

    i.bulk-actions-icons, i.bulk-actions-icons-select {
      font-size: 20px;
	    color: @black80;
    }

    i.bulk-actions-icons-select {
      .margin-left(10px);
      .margin-right(-8px);
    }

    i.fa-check {
      color: @rui-success;
    }
  }
}

.order-toggle-btn {
  border: none;
  background: transparent;

  &:focus {
    outline: none;
  }

  i {
    width: 18.5px;
    height: 16px
  }
}

.order-toggle-btn.order-icon-toggle {
  color: @rui-brand;
}

.order-toggle-buttons {
  float: right;
}

.status-dropdown {
  position: relative !important;
  width: 274px;
  border: solid 1px @rui-default;
  border-radius: 3px;
  background-color: @white;
  box-shadow: 0 0 4px 2px rgba(0, 0, 0, 0.16);

  &:before, &:after {
    content: '';
    position: absolute;
    display: block;
    border-style: solid;
    .left(90%);
    z-index: 100;
  }
  &:before {
    top: -21px;
    border-color: transparent transparent @rui-default transparent;
    border-width: 10px;
  }
  &:after {
    top: -19px;
    border-color: transparent transparent @white transparent;
    border-width: 10px;
  }

  .order-menu-item-dropdown {
    a {
      margin-bottom: 5px;
      margin-top: 5px;
      text-decoration: none;
      outline: none;
      background-color: transparent;
      font-size: 16px;
      line-height: 1.9;
      color: @rui-default-text;
      .text-align(left);
    }

    a:hover {
      background-color: #f7f7f7;
      color: @rui-default-text;
    }
  }
}

.calender-dropdown {
  position: relative !important;
  width: 321px;
  border: solid 1px @rui-default;
  border-radius: 3px;
  background-color: @white;
  box-shadow: 0 0 4px 2px rgba(0, 0, 0, 0.16);

  &:before, &:after {
    content: '';
    position: absolute;
    display: block;
    border-style: solid;
    .left(91.5%);
    z-index: 100;
  }
  &:before {
    top: -21px;
    border-color: transparent transparent @rui-default transparent;
    border-width: 10px;
  }
  &:after {
    top: -19px;
    border-color: transparent transparent @white transparent;
    border-width: 10px;
  }
}

.order-filter-bar {
  display: flex;
  height: 51px;

  .order-filter-item {
    display: flex;
    .flex(1 1 auto);
    width: 33%;
    height: 100%;
    align-items: center;
    background-color: #f7f7f7;
    margin: 0 .5px 0 .5px;
    justify-content: flex-start;
    position: relative;
  }

  .order-filter-label {
    display: flex;
    flex-direction: row;
    height: 100%;
    width: 100%;
    justify-content: center;
    align-items: center;
  }

  .order-filter-name {
    font-size: 16px;
    .flex(0 1 auto);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);

    &.active {
      color: @rui-brand
    }
  }

  .order-filter-icons {
    .flex(0 1 auto);
    .margin-left(auto);
  }

  .order-filter-button {
    padding: 0;

    &.active {
      color: @rui-brand
    }
  }

  .order-filter-dropdown-button {
    .padding-left(0);
  }

  .order-filter-dropdown-button:focus {
    outline: none;
  }

  .order-filter-button:focus {
    outline: none;
  }
}

.order-dashboard-container {
  .order-search {
    position: relative;
    .form-group {
      margin-bottom: 0;
    }
    .search-input {
      font-size: @font-size-base;
      .padding-left(60px);
      border-width: 1px 0;
    }
    .btn {
      text-decoration: underline;
    }
    .btn, .fa {
      position: absolute;
      top: 50%;
      .right(50px);
      margin-top: -14px;
      padding: 0;
      font-weight: normal
    }
    .fa {
      .left(25px);
      font-size: @font-size-large;
      margin-top: -8px;
    }
  }
}

@media only screen and (max-width: 360px) {
  .order-filter-bar {
    max-width: 90%;
  }
}

@media only screen and (max-width: 380px) {
  .order-filter-bar {
    max-width: 94%;
  }

  .order-filter-bar .order-filter-name {
    left: initial;
    margin-right: auto
  }

  .order-filter-bar .order-filter-icons  {
    margin-left: 35% !important

  }
}

@media only screen and (max-width: 320px) {
  .order-filter-bar {
    max-width: 80%;
  }

  .order-filter-bar .order-filter-name {
    left: 50%;
  }

  .order-filter-bar .order-filter-icons  {
    margin-left: 70% !important;
  }

  .order-dashboard-container .order-search .btn {
    .right(90px);
  }
}

@media only screen and (max-width: 560px) {
  .status-dropdown {
    left: 130px;

    &:before, &:after {
      left: 42% !important;
    }
  }
}

@media only screen and (max-width: 350px) {
  .hidden-xs {
    display: none;
  }

  .rui.order.table {
    max-width: 100%;
  }
}

@media only screen and (max-width: 895px) and (min-width: 1264px) {
  .rui.admin.action-view-pane.action-view > div[data-radium] {
    width: 50%;
  }
}

.capitalize {
  text-transform: capitalize;
}

.orders-table-container {
  display: flex;
  flex-direction: column;
}

.order-details-list-container {
  display: flex;
  flex-direction: column
}

.order-details-table {
  width: 100%;
  margin: 0 auto;
}

.risk-info {
  text-transform: capitalize;
  padding: @padding-small-vertical;
  vertical-align: top;
  &.risk-info-detail {
    margin: 0 5px;
    border-radius: @border-radius-large;
    padding: @padding-small-vertical @padding-small-horizontal;
    height: auto;
    vertical-align: middle;
  }
  &.risk-tax {
    margin-left: @padding-small-horizontal;
    background: @rui-danger-bg;
    color: @rui-danger-text;
    border-color: @rui-danger;
    padding: 2px 4px 2px 4px;
    border: 1px solid;
    border-radius: 3px;
    display: inline;
    vertical-align: middle;
  }
  &.elevated {
    background-color: fade(@rui-warning, 10%);
    border: 1px solid @rui-warning;
    color: darken(@rui-warning, 30%);
  }
  &.high {
    background-color: fade(@rui-danger, 10%);
    border: 1px solid @rui-danger;
    color: darken(@rui-danger, 30%);
  }
}
